-
-
Notifications
You must be signed in to change notification settings - Fork 402
Creates an executor for respecting the user script loader threads configuration #8011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev/feature
Are you sure you want to change the base?
Creates an executor for respecting the user script loader threads configuration #8011
Conversation
* @return the executor used for submitting tasks. Can be null if called before Skript loads config.sk | ||
*/ | ||
@UnknownNullability | ||
public static Executor getExecutor() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This executor seems like it could take the place of the existing loadQueue
used for distributing tasks, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loadQueue is a bad implementation, unsure if Skript or addons actually use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skript uses it for asynchronous / parallel loading. I doubt any addons use it.
Problem
Being able to submit runnables on the script loader configuration pool through an Executor.
Solution
Use Java's Executor to be able to submit runnables based on the users config.sk setting. Helpful for addon developers and Skript.
Also added support in Skript's Task util class.
Useful for things that needs to be submitted like streams.
See Pickle's comment at #7962 (comment)
Since my other Task util pull request got closed for some reason, I re-added my javadoc comments.